export default function (app) {
  app.directive("removeReadonly", {
    mounted(el, binding) {
      let element = el.getElementsByClassName("el-input__inner")[0];
      element.addEventListener("focus", function (e) {
        this.removeAttribute("readonly");
      });
    },
  });
  app.directive("focus", {
    mounted(el, binding) {
      let time = binding.value || 0;
      let timer;
      if (timer) {
        clearTimeout(timer);
      }
      setTimeout(() => {
        let element = el.getElementsByClassName("el-input__inner")[0];
        element.focus();
      }, time);
    },
  });
}
